<script setup>
import VueOfficePdf from '@vue-office/pdf'
import {defineProps,ref,defineExpose,computed} from 'vue'

const props = defineProps({
  previewUrl: {
    type: String,
    default: "",
    required: true,
  },
  fileType: {
    type: String,
    required: true
  },
})

const previewVisible = ref(false)

// 定义一个方法来切换预览可见性
const togglePreview = () => {
  previewVisible.value = !previewVisible.value
}

// 暴露方法给父组件
defineExpose({
  togglePreview
})
</script>

<template>
  <a-modal
      ok-text="确认"
      cancel-text="取消"
      width="80%"
      v-model:open="previewVisible"
      title="简历预览"
      @cancel="previewVisible = false"
  >
    <vue-office-pdf :src="previewUrl"/>
  </a-modal>
</template>

<style scoped>
</style>